Skip to content

multiple SSPs/BEs support for SOF--Kernel Part - #4

Merged
plbossart merged 10 commits into
thesofproject:topic/sof-devfrom
keyonjie:sof-pr
Jul 2, 2018
Merged

multiple SSPs/BEs support for SOF--Kernel Part#4
plbossart merged 10 commits into
thesofproject:topic/sof-devfrom
keyonjie:sof-pr

Conversation

@keyonjie

Copy link
Copy Markdown

We need SOFT part merged together, that is stream_name rename for nocodec topology to make nocodec topology works.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand what this patchset fixes compared to the previous version, this is still somewhat messy in terms of link declaration, setup and handling of multiple outputs.

Comment thread sound/soc/sof/intel/apl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 ch?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it original from Liam, And it is the maximum of cpu_dai caps, it can still be reduced by the FE/PCM caps:
hw->channels_min = max(chan_min, cpu_stream->channels_min);
hw->channels_max = min(chan_max, cpu_stream->channels_max);

so I think leaving them as 16 has no harm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 chan is correct, my original value is wrong.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let me change them to 8 in v3.

Comment thread sound/soc/sof/intel/apl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you look at Rakesh's patches, I think we could update this with Analog, Alt-Analog and Digital?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I will go and get that for HDMI enabling, I believe we may need to refine them during enabling each BEs, as I talked previously, it's not one shot fix, it is only framework implementation here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyon, can you check the HDA/HDMI naming should be consistent per platform (but it may change between different platforms).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed they are same with cAVS ones defined in skl-pcm.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant use something this instead, see alsa-devel [PATCH v3 11/13] ASoC: hdac_hda: add asoc extension for legacy HDA codec drivers

+static struct snd_soc_dai_driver hdac_hda_dais[] = {
+{

  • .id = HDAC_ANALOG_DAI_ID,
  • .name = "Analog Codec DAI",
  • .ops = &hdac_hda_dai_ops,
  • .playback = {
  •   .stream_name	= "Analog Codec Playback",
    
  •   .channels_min	= 1,
    
  •   .channels_max	= 16,
    
  •   .rates		= SNDRV_PCM_RATE_8000_192000,
    
  •   .formats	= STUB_FORMATS,
    
  •   .sig_bits	= 24,
    
  • },
  • .capture = {
  •   .stream_name    = "Analog Codec Capture",
    
  •   .channels_min   = 1,
    
  •   .channels_max   = 16,
    
  •   .rates = SNDRV_PCM_RATE_8000_192000,
    
  •   .formats = STUB_FORMATS,
    
  •   .sig_bits = 24,
    
  • },
    +},
    +{
  • .id = HDAC_DIGITAL_DAI_ID,
  • .name = "Digital Codec DAI",
  • .ops = &hdac_hda_dai_ops,
  • .playback = {
  •   .stream_name    = "Digital Codec Playback",
    
  •   .channels_min   = 1,
    
  •   .channels_max   = 16,
    
  •   .rates          = SNDRV_PCM_RATE_8000_192000,
    
  •   .formats        = STUB_FORMATS,
    
  •   .sig_bits = 24,
    
  • },
  • .capture = {
  •   .stream_name    = "Digital Codec Capture",
    
  •   .channels_min   = 1,
    
  •   .channels_max   = 16,
    
  •   .rates = SNDRV_PCM_RATE_8000_192000,
    
  •   .formats = STUB_FORMATS,
    
  •   .sig_bits = 24,
    
  • },
    +},
    +{
  • .id = HDAC_ALT_ANALOG_DAI_ID,
  • .name = "Alt Analog Codec DAI",
  • .ops = &hdac_hda_dai_ops,
  • .playback = {
  •   .stream_name	= "Alt Analog Codec Playback",
    
  •   .channels_min	= 1,
    
  •   .channels_max	= 16,
    
  •   .rates		= SNDRV_PCM_RATE_8000_192000,
    
  •   .formats	= STUB_FORMATS,
    
  •   .sig_bits	= 24,
    
  • },
  • .capture = {
  •   .stream_name    = "Alt Analog Codec Capture",
    
  •   .channels_min   = 1,
    
  •   .channels_max   = 16,
    
  •   .rates = SNDRV_PCM_RATE_8000_192000,
    
  •   .formats = STUB_FORMATS,
    
  •   .sig_bits = 24,
    
  • },
    +}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we need 3 for HDA legacy codecs? And should this be same for all platforms?

Comment thread sound/soc/sof/intel/apl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't get how we handle multiple nocodec outputs with this solution?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple nocodec cpu_dais are created during probing, each dai driver defined in platform driver(e.g. apl.c) will be used and corresponding nocodec dai_link will be created in sof_nocodec_setup().

Comment thread sound/soc/sof/intel/cnl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to use common tables when APL/CNL/ICL are identical?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is possible, but separating them is more flexible at the moment in my opinion, if they are totally same after all our features are implemented and they do have no difference, we can merge them then.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSP rates on all the platforms are the same atm, so safe to merge.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Liam, sorry can't get your point here, so do all of us aligned on using common tables for APL/CNL/ICL?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about putting it in hda-pcm.c?

Comment thread sound/soc/sof/intel/skl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure SKL/KBL don't have 6 SSPs

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's shrink them then.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way, do you know how much we have for that? I get information from cAVS 1.5 HAS that I2SPC is 3, but the document claims it support all BXT/GLK/SPT platforms.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per my understanding, for SKL+, cAVS driver use the common table defined in skl-pcm.c, that is the same table we defined in apl.c/cnl.c/skl.c, so here for SKL/KBL, let's keep it, which is same with cAVS one?

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we set formats that are not valid except for SSP, and how we deal with DMIC or HDAudio with this work.
Specifically with DMIC we know it's capture only so shouldn't we look at the information in ops->drv[i] to avoid changing things that make limited sense?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it is for nocodec only, but maybe you are right, if somebody defines to use nocodec DMIC in tplg file, then...

again, this BE.dai_fmt for nocodec actually don't take any effect, maybe I should remove this assignment here to make you feel more relax. :)

Comment thread sound/soc/sof/intel/skl.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this still needed to have a nocodec-dai?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, let me fix it, thanks.

@keyonjie

Copy link
Copy Markdown
Author

update to v2 with addressing some comments.

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file can be completely removed now and this function should be in sof/utils.c
I would also change this function to sof_platform_add_all_bes()

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about the probe()/remove(), the platform driver, and the card sound card register invoking?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are fine, they should register the card and get around any deferred probe binding.

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer "sof-nocodec" as this code can be used for platforms that support add-in audio cards/devices. We should probably pass this in.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liam's comment was not addressed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a call with Liam about this, and aligned to keep this no-codec driver and keep it simple. The reason for it is that we can't leverage deffer probe without using platform probing.

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename nocodec_ -> sof_platform_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, Liam's comment isn't addressed.

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if this fails ? Need to handle errors

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me add handle of this.

Comment thread sound/soc/soc-core.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this into my upstream patch.

keyonjie and others added 3 commits June 28, 2018 18:31
Register all DAI from platform driver

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor things to fix for me.

Comment thread sound/soc/sof/intel/hda-dai.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth commenting here that some products who use this DAI array only physically have a subset of the DAIs, but no harm is done here by adding the whole set.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Comment thread sound/soc/sof/intel/byt.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHT has 6 SSPs, best to add them and include a comment.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure CHT has 6 SSPs? I see from your previous patch series that it is set and commented as 3/

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and 3 is same with sst-mfld-platform-pcm.c also.

/* BE CPU Dais */
{
.name = "ssp0-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp0 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp0 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
{
.name = "ssp1-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp1 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp1 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
{
.name = "ssp2-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp2 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp2 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are fine, they should register the card and get around any deferred probe binding.

@xiulipan

Copy link
Copy Markdown

You may need to refine the the code here to make dai link can be found for the codec machine drivers.

struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,

This will cause some machine driver dai could not found. It may fix
thesofproject/soft#9

@keyonjie

Copy link
Copy Markdown
Author

xiuli, the issue you mentioned should be fixed in tplg file, we should set .id value for DAI in test codec tplg.

@keyonjie

Copy link
Copy Markdown
Author

Liam/Pierre, just updated, please help review.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost looks good, just a couple of minors comments to look into. Thanks Keyon.

Comment thread sound/soc/sof/intel/hda-dai.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? Can we add later when it's actually doing something?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you meaning this hda-dai.c file? this is suggested by Liam to add, and it addressing your comment about common dai driver table for SKL/APL/CNL also.

Comment thread sound/soc/sof/intel/hda-dai.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the max number of channels should be 16 for HDAudio (same for all digital parts below)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please feel free to change it, as I am not able to test them yet, so I can't give any comment about it.

Comment thread sound/soc/sof/intel/bdw.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we support FLOAT on BDW? (same comments for all machines btw, I don't think we can deal with FLOAT on a DAI.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also initiated by Liam, Liam, do you have comment on it?

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liam's comment was not addressed?

Comment thread sound/soc/sof/nocodec.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, Liam's comment isn't addressed.

lrgirdwo and others added 7 commits July 2, 2018 22:20
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This patch create nocodec BE DAI links based on platform dai drivers,
with it, we can support multiple SSP/BEs for nocodec mode.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
1. Don't override cpu_dai_name, we will reuse those defined in machine
driver.
2. We should keep dpcm_playback and dpcm_capture defined for BEs, not
both of them are supported by BEs sometimes.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
…dynamic

We should use .dynamic for all FE dai_links, so change probe and trace
buffer ones here to align to that.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
@keyonjie

keyonjie commented Jul 2, 2018

Copy link
Copy Markdown
Author

Hi Pierre/Liam, new version updated, I think it address all comments from you, please help review.

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one isolated 16->8 ch issue that needs to be fixed in a follow-up patch. let's merge this.

.name = "SSP2 Pin",
.playback = SOF_DAI_STREAM("ssp2 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp2 Rx", 1, 16,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, let me send incremental fix soon.

@plbossart
plbossart merged commit 5be0d42 into thesofproject:topic/sof-dev Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants